<?php 
class task_model extends CI_Model {
        function __construct()
        {
                parent::__construct();        
                $this->load->helper("local");
                $this->load->helper('date');
                $this->load->database();
        } 
//START-----------------dv-------------------------//              
        
		
		function get_all_task()
        {
			    $this->load->database();
                $query = $this->db->query("select * from task where task_id order by task_id DESC");
			return $query->result();
        }
function getSearchBytask($search_value,$column_value)
       {    
 $sql = "select * from task  ";
		//$query = $this->db->query($sql . " order by " . $column_value . " asc Limit 10 ");
		$query = $this->db->query ("select * from task where $column_value like '%$search_value%' order by task_id ASC Limit 10");
				return $query->result();
       }	

	   function getdvSearchBytask111($search)
       {    
 $sql = "select * from task where t_from like '%$search%' or t_to like '%$search%' ";
	   $query = $this->db->query($sql . " order by " . $search . " asc Limit 10 ");
	   //$query = $this->db->query ("select * from task where t_from like '%$search%' or t_to like '%$search%' order by task_id ASC Limit 10");
				return $query->result();
       }
		
        function gettask_info($code)
        {        
                $query = $this->db->query("select *from task where task_id='$code'");
                 //return $query->result();
				 return $query->row();

				 
        }

//End-----------------dv -------------------------//              		

}
?>
